package com.carlinfo.userscenter.users.pojo;

import java.util.Date;

public class AAdmins
{

	/*列模式:alt + shift + a*/
	
	private int id;
	private int roleId;
	private String email;
	private String password;
	private String photoPath;
	private String trueName;
	private String phone;
	private String qq;
	private int loginFailedCount;
	private Date loginFailedTime;
	private int loginCount;
	private String lastLoginIp;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date pubTime;
	private Date lastloginTime;
	
	/* 
	 * 关联对象
	 * 朝代和皇上
	 * */
	private ARole role;
	
	private String statusStr ;

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public int getRoleId()
	{
		return roleId;
	}

	public void setRoleId(int roleId)
	{
		this.roleId = roleId;
	}

	public String getEmail()
	{
		return email;
	}

	public void setEmail(String email)
	{
		this.email = email;
	}

	public String getPassword()
	{
		return password;
	}

	public void setPassword(String password)
	{
		this.password = password;
	}

	public String getPhotoPath()
	{
		return photoPath;
	}

	public void setPhotoPath(String photoPath)
	{
		this.photoPath = photoPath;
	}

	public String getTrueName()
	{
		return trueName;
	}

	public void setTrueName(String trueName)
	{
		this.trueName = trueName;
	}

	public String getPhone()
	{
		return phone;
	}

	public void setPhone(String phone)
	{
		this.phone = phone;
	}

	public String getQq()
	{
		return qq;
	}

	public void setQq(String qq)
	{
		this.qq = qq;
	}

	public int getLoginFailedCount()
	{
		return loginFailedCount;
	}

	public void setLoginFailedCount(int loginFailedCount)
	{
		this.loginFailedCount = loginFailedCount;
	}

	public Date getLoginFailedTime()
	{
		return loginFailedTime;
	}

	public void setLoginFailedTime(Date loginFailedTime)
	{
		this.loginFailedTime = loginFailedTime;
	}

	public int getLoginCount()
	{
		return loginCount;
	}

	public void setLoginCount(int loginCount)
	{
		this.loginCount = loginCount;
	}

	public String getLastLoginIp()
	{
		return lastLoginIp;
	}

	public void setLastLoginIp(String lastLoginIp)
	{
		this.lastLoginIp = lastLoginIp;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getPubTime()
	{
		return pubTime;
	}

	public void setPubTime(Date pubTime)
	{
		this.pubTime = pubTime;
	}

	public Date getLastloginTime()
	{
		return lastloginTime;
	}

	public void setLastloginTime(Date lastloginTime)
	{
		this.lastloginTime = lastloginTime;
	}

	@Override
	public String toString()
	{
		return "AAdmins [id=" + id + ", roleId=" + roleId + ", email=" + email + ", password=" + password
				+ ", photoPath=" + photoPath + ", trueName=" + trueName + ", phone=" + phone + ", qq=" + qq
				+ ", loginFailedCount=" + loginFailedCount + ", loginFailedTime=" + loginFailedTime + ", loginCount="
				+ loginCount + ", lastLoginIp=" + lastLoginIp + ", status=" + status + ", createTime=" + createTime
				+ ", updateTime=" + updateTime + ", pubTime=" + pubTime + ", lastloginTime=" + lastloginTime + "]";
	}

	public ARole getRole()
	{
		return role;
	}

	public void setRole(ARole role)
	{
		this.role = role;
	}

	public String getStatusStr_Source()
	{
		if(this.status == 0 )
		{
			this.statusStr = "禁用" ; 
		}else if(this.status == 1)
		{
			this.statusStr = "启用" ; 
		}
		return statusStr;
	}
	
	public String getStatusStr()
	{
		AAdminsEnum[] values = AAdminsEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			AAdminsEnum adminsEnumTemp = values[i];
			if(adminsEnumTemp.toString().startsWith("STATUS"))
			{
				if(adminsEnumTemp.getStatus() == this.status)
				{
					this.statusStr = adminsEnumTemp.getName(); 
				}
			}
		}
		return statusStr;
	}

	

}
